<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>LottieFiles - Example</title>
    <!-- 引入cdn插件 -->
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/lottie-web/5.10.2/lottie.js"></script> -->
    <!-- 引入本地插件 -->
    <script src="lottie.js"></script>
    <style>
      body {
        width: 100vw;
        height: 100vh;
        margin: 0;
        display: flex;
      }
      #root {
        width: 50vw;
        height: 50vh;
        margin: auto;
        position: relative;
      }
    </style>
  </head>
  <body>
    <!-- 动画容器 -->
    <div id="root"></div>

    <script>
      // 动画设置
      let animData = {
        wrapper: document.getElementById("root"),
        animType: "svg", // html,canvas,svg
        loop: true,
        prerender: true,
        autoplay: true,
        path: "animate.json", // 动画JSON文件，在官网下载
      };
      // 加载动画
      let anim = bodymovin.loadAnimation(animData);
    </script>
  </body>
</html>
